Let's add in the sprite controls.

  • Add Left Key, Right Key, Up Key, and Down Key to move your sprite around.
  • Drag in a Collision with Other Sprite event into your program.
  • Drag Global Variable into the collision event. Change variable to recycle_xp.
  • Change my_var to litter. Change the if statement to test if litter is in the recycle list.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)